package test6;

import java.lang.annotation.*;

@Inherited // 可继承 子类继承父类的注解
@Documented // 可生成文档
@Target({ElementType.FIELD, ElementType.METHOD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
    String name() default "xsj";
}

@MyAnnotation(name = "Hello")
class B {
    @MyAnnotation(name = "Hello")
    public void test(){
        System.out.println("Hello World!");
    }
    
    @MyAnnotation(name= "您好")
    private String name;
}

class C extends B {
}